<!--ask if wanna use #s
lowercase
uppercase
length of password
-->
<head>
<script type="text/javascript">
//INITIAL//
	var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	var lowercase = "abcdefghijklmnopqrstuvwxyz";
	var numbers = "0123456789";
	var values = "";
	var password = "";
//
//FUNCTION//
	function caller(){
		alert("I will now create a random password for you.");
		var num_flag = confirm("Will it contain numbers?");
			if (num_flag == true){
				values+=numbers;
			}
		var upp_flag = confirm("Will it contain lowercase letters?");
			if (upp_flag == true){
				values+=uppercase;
			}
		var low_flag = confirm("Will it contain uppercase letters?");
			if (low_flag == true){
				values+=lowercase;
			}
		var char_flag = prompt("How many characters will it be?", "#");
		var passlength = parseInt(char_flag);
		document.write(passlength);
		var i = 0;
		while (i < passlength){
			var rand = Math.floor(Math.random()*values.length);
			password+=values.charAt(rand);
			i++;
		}document.write(password);
	}
//
</script>
</head>
<body>
<button type ="button" onClick ="caller()">
Press me to generate a password.
</button>
</body>
